﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuickRunnable.Quick
{
    class Class1
    {
        public void Test()
        {
            List<List<Object>> bucket_list = new List<List<object>>();
            for (int i = 0; i < 4; i++)
            {
                List<Object> list = new List<Object>();
                bucket_list.Add(list);
                for (int j = 0; j < 4; j++)
                {
                    list.Add(i.ToString() + "," + j.ToString());
                }
            }
            GetAll(bucket_list);
        }

        public static void Visit( String lhs, int x, List<List<Object>> full_list ) {
            List< Object > target_list = full_list[ x ];

            for (int i = 0; i < target_list.Count; i++) {
                string inner_lhs = lhs + "," + i;
                
                if( x + 1 < full_list.Count ) {
                    Visit( inner_lhs, x+1, full_list );
                } else {
                    Console.WriteLine(inner_lhs);
                }
            }
        }

        public static void GetAll(List<List<Object>> full_list) { Visit( "",0, full_list ); }
    }
}
